Log in Register Dashboard Temp Share Shortlinks Frames API

cody - HTMLify profile

cody's Profile Picture

cody

4270 Files

632542 Views

Latest files of /cody/solygambas/html-css-javascript-projects/044-custom range slider

style.css cody/solygambas/html-css-javascript-projects/044-custom range slider/style.css
149 Views
0 Comments
@import url("https://fonts.googleapis.com/css2?family=Lato&display=swap");

* {
box-sizing: border-box;
}

body {
background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
index.html cody/solygambas/html-css-javascript-projects/044-custom range slider/index.html
335 Views
0 Comments
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Custom Range Slider</title>
</head>
script.js cody/solygambas/html-css-javascript-projects/044-custom range slider/script.js
229 Views
0 Comments
const range = document.getElementById("range");

// https://stackoverflow.com/questions/10756313/javascript-jquery-map-a-range-of-numbers-to-another-range-of-numbers
const scale = (num, in_min, in_max, out_min, out_max) => {
return ((num - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min;
};

range.addEventListener("input", (e) => {